<?php if(!defined('PHPOK_SET')){die('<h3>Error...</h3>');}?><?php QG_C_TEMPLATE::p("global_head","","0");?>
<?php QG_C_TEMPLATE::p("right.css","","0");?>
<?php QG_C_TEMPLATE::p("right.head","","0");?>

<!-- 会员管理 -->
<?php if($sysAct == "add" || $sysAct == "modify"){?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	<a href="admin.php?file=user&act=list">会员列表</a> &raquo;
	<?php if($sysAct == "add"){?>添加新会员<?php }else{ ?>编辑会员<?php } ?>
	<input type="button" value="会员列表" onclick="qgurl('admin.php?file=user&act=list')">
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<form method="post" action="admin.php?file=user&act=viewok&id=<?php echo $id;?>" onsubmit="return add_msg();">
<tr>
	<td class="left">账号：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="username" id="username" value="<?php echo $rs[user];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">密码：<span style="color:red;">*</span></td>
	<td class="right">
		<input type="text" name="password" id="password" value="<?php echo $rs[pass];?>">
		<?php if($sysAct == "modify"){?>
		<span class="clue_on">[不修改密码请不要改动内容]</span>
		<?php }else{ ?>
		<span class="clue_on">[默认密码是123456]</span>
		<?php } ?>
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">姓名：</td>
	<td class="right">
		<input type="text" name="realname" id="realname" value="<?php echo $rs[realname];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">性别：</td>
	<td class="right">
		<select name="gender">
		<option value="0"<?php if($rs[gender] == 0){?> selected<?php } ?>>不限</option>
		<option value="1"<?php if($rs[gender] == 1){?> selected<?php } ?>>男性</option>
		<option value="2"<?php if($rs[gender] == 2){?> selected<?php } ?>>女性</option>
		</select>
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">邮箱：</td>
	<td class="right">
		<input type="text" name="email" id="email" value="<?php echo $rs[email];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">手机或电话：</td>
	<td class="right">
		<input type="text" name="phone" id="phone" value="<?php echo $rs[phone];?>">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">联系地址：</td>
	<td class="right">
		<input type="text" name="address" id="address" value="<?php echo $rs[address];?>" class="long_input">
	</td>
</tr>
</table>
</div>

<div class="table" onmouseover="this.className='table table1'" onmouseout="this.className='table'">
<table width="100%">
<tr>
	<td class="left">邮政编码：</td>
	<td class="right">
		<input type="text" name="zipcode" id="zipcode" value="<?php echo $rs[postmail];?>" class="short_input">
	</td>
</tr>
</table>
</div>
<?php $button_msg = $sysAct == "modify" ? "编辑会员" : "添加会员";;?>
<div class="table">
<table width="100%">
<tr>
	<td class="left"></td>
	<td class="right"><input type="submit" id="creat_button" class="mybutton_01" value="<?php echo $button_msg;?>"> &nbsp; <span id="show_step" style="color:red;"></span></td>
</tr>
</form>
</table>
</div>
<script type="text/javascript">
function add_msg(msg)
{
	var username = $("username").value;
	if(!username)
	{
		alert("账号不允许为空");
		return false;
	}

	$("show_step").innerHTML = "<img src='admin/tpl/images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";

	$("creat_button").disabled = true;
}
</script>

<?php }elseif($sysAct == "list"){ ?>
<div class="table2" style="text-align:left;">
	<a href="admin.php?file=index">系统首页</a> &raquo;
	会员列表
	<input type="button" value="添加新会员" onclick="qgurl('admin.php?file=user&act=add')">
</div>

<div class="table">
	<table cellpadding="1" cellspacing="0">
	<form method="post" action="admin.php?file=user&act=list">
	<tr>
		<td><input type="text" name="keywords" id="keywords" value="<?php echo $keywords;?>"></td>
		<td>
			<select name="stype" id="stype">
			<option value="user"<?php if($stype == "user"){?> selected<?php } ?>>会员</option>
			<option value="realname"<?php if($stype == "realname"){?> selected<?php } ?>>真实姓名</option>
			<option value="email"<?php if($stype == "email"){?> selected<?php } ?>>邮箱</option>
			<option value="phone"<?php if($stype == "phone"){?> selected<?php } ?>>联系方式</option>
			<option value="address"<?php if($stype == "address"){?> selected<?php } ?>>联系地址</option>
			</select>
		</td>
		<td>
			<input type="submit" value="搜索" class="mybutton_01">
		</td>
		</form>
	</tr>
	</table>
</div>

<table width="100%" cellpadding="0" cellspacing="0">
<tr>
	<td style="border-bottom:1px #D4D4D4 solid;"><img src="admin/tpl/images/blank.gif" border="0" width="1" height="1"></td>
</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0">
<tr class="table table2">
	<td height="23px" class="msg_subject_id b_b">会员ID</td>
	<td class="msg_subject b_b">会员账号</td>
	<td class="msg_subject b_b">会员邮箱</td>
	<td class="msg_postdate b_b">操作</td>
</tr>
<?php $_i=0;$rslist=(is_array($rslist))?$rslist:array();foreach($rslist AS  $key=>$value){$_i++; ?>
<tr class="m_out" onmouseover="this.className='m_over'" onmouseout="this.className='m_out'">
	<td height="25px" align="center" class="b_b"><?php echo $value[id];?></td>
	<td align="left" class="b_b"><?php echo $value[user];?></td>
	<td align="left" class="b_b"><?php echo $value[email];?></td>
	<td align="center" class="b_b">
		<input type="button" value="编辑" class="mybutton_01" onclick="qg_modify(<?php echo $value[id];?>)">
		<input type="button" value="删除" class="mybutton_01" onclick="qg_delete(<?php echo $value[id];?>)">
	</td>
</tr>
<?php } ?>
</table>

<div align="right"><?php echo $pagelist;?></div>
<script type="text/javascript">
function qg_modify(id)
{
	window.location.href="admin.php?file=user&act=modify&id="+id;
}
function qg_delete(id)
{
	//判断是否删除
	question = confirm("确认删除该信息吗？特别说明，删除后无法恢复！");
	if (question != "0")
	{
		qgurl("admin.php?file=user&act=delete&id="+id);
	}
}
</script>
<?php } ?>